import dva from 'dva';
import createHistory from 'history/createBrowserHistory';
import './index.css';

import users from './models/users';
import status from './models/status';
import message from './models/message';

// 1. Initialize
const app = dva({
  initialState: {},
  history: createHistory(),
  onError(err, dispatch) {
    console.log(err.message);
  }
});

// 2. Plugins
app.use({});

// 3. Model
app.model(users);
app.model(status);
app.model(message);

// 4. Router
app.router(require('./routers/router').default);

// 5. Start
app.start('#root');
